package com.simon.simplefactorypattern;

public class TVFactory {
	public static TV produceTV(String Brand) throws Exception{
		if(Brand.equalsIgnoreCase("Haier")) {
			System.out.println("电视机工厂生产海尔电视");
			return new HaierTV();
		}else if (Brand.equalsIgnoreCase("Hisense")) {
			System.out.println("电视机工厂生产海信电视");
			return new HisenseTV();
		}else {
			throw new Exception("对不起，咱不能生产该品牌的电视！");
		}
	}
}
